]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
status/network: Remove WireguardItem
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 2 Aug 2022 09:50:05 +0000 (11:50 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 7 Aug 2022 20:41:09 +0000 (22:41 +0200)
Wireguard connections are now covered by the VPN item.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2406>

js/ui/status/network.js

index 64f44a93ec4057cdb188755d1b35d76dbc1ec5f9..5e0c05634dbff76004e726ab14cf8692d1de6f16 100644 (file)
@@ -1393,49 +1393,6 @@ var NMWirelessDeviceItem = class extends Signals.EventEmitter {
     }
 };
 
-var NMWireguardItem = class extends NMConnectionItem {
-    _buildUI() {
-        this.labelItem = new PopupMenu.PopupMenuItem('');
-        this.labelItem.connect('activate', this._activate.bind(this));
-
-        this.radioItem = new PopupMenu.PopupSwitchMenuItem(this._connection.get_id(), false);
-        this.radioItem.connect('toggled', this._toggle.bind(this));
-    }
-
-    _sync() {
-        let isActive = this.isActive();
-        this.labelItem.label.text = isActive ? _('Turn Off') : this._section.getConnectLabel();
-        this.radioItem.setToggleState(isActive);
-        this.emit('icon-changed');
-    }
-
-    _connectionStateChanged() {
-        const state = this._activeConnection?.get_state();
-        const reason = this._activeConnection?.get_state_reason();
-
-        if (state === NM.ActiveConnectionState.DEACTIVATED &&
-            reason !== NM.ActiveConnectionStateReason.NO_SECRETS &&
-            reason !== NM.ActiveConnectionStateReason.USER_DISCONNECTED)
-            this.emit('activation-failed');
-
-        this.emit('icon-changed');
-        super._connectionStateChanged();
-    }
-
-    getIndicatorIcon() {
-        if (this._activeConnection) {
-            if (this._activeConnection.state === NM.ActiveConnectionState.UNKNOWN)
-                return '';
-            else if (this._activeConnection.state < NM.ActiveConnectionState.ACTIVATED)
-                return 'network-vpn-acquiring-symbolic';
-            else
-                return 'network-vpn-symbolic';
-        } else {
-            return '';
-        }
-    }
-};
-
 var NMVpnConnectionItem = class extends NMConnectionItem {
     _buildUI() {
         this.labelItem = new PopupMenu.PopupMenuItem('');
@@ -1537,9 +1494,6 @@ var NMVpnSection = class extends NMConnectionSection {
     }
 
     _makeConnectionItem(connection) {
-        if (connection.get_connection_type() === 'wireguard')
-            return new NMWireguardItem(this, connection);
-
         return new NMVpnConnectionItem(this, connection);
     }